package models

import (
	"time"
)

// Admin 管理员表
type Admin struct {
	Id          uint64    `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
	Username    string    `gorm:"column:username;type:varchar(100);comment:账号;NOT NULL" json:"username"`
	Nickname    string    `gorm:"column:nickname;type:varchar(100);comment:昵称;NOT NULL" json:"nickname"`
	Mobile      string    `gorm:"column:mobile;type:varchar(200);comment:手机号;NOT NULL" json:"mobile"`
	Password    string    `gorm:"column:password;type:varchar(255);comment:密码;NOT NULL" json:"password"`
	Status      int       `gorm:"column:status;type:tinyint(2);default:1;comment:状态：0禁用1启用;NOT NULL" json:"status"`
	CreatedTime time.Time `gorm:"column:created_time;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"created_time"`
	UpdatedTime time.Time `gorm:"column:updated_time;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"updated_time"`
}

func (m *Admin) TableName() string {
	return "admin"
}
